/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.bridge.major;

import java.util.Collection;
import java.util.Collections;
import ru.jSkyRoom.interfaces.major.Major;
import ru.jSkyRoom.interfaces.major.Outfit;
import skyproc.FormID;
import skyproc.OTFT;

/**
 *
 * @author Rakev
 */
public class OutfitBridge extends MajorBridge<OTFT> implements Outfit {

    public OutfitBridge(OTFT adapting) {
        super(adapting);
    }

    @Override
    public Collection<Major> getInventoryList() {
        Collection<FormID> ids = getRawObject().getInventoryList();
        Collection<Major> result = getFinderFactory().createOutfitElementsFinder().find(ids);
        return Collections.unmodifiableCollection(result);
    }

    @Override
    public void addInventoryItem(Major item) {
        FormID id = getIdProducer().produce(item);
        getRawObject().addInventoryItem(id);
    }

    @Override
    public void removeInventoryItem(Major item) {
        FormID id = getIdProducer().produce(item);
        getRawObject().removeInventoryItem(id);
    }

}
